package model;

public class Player {

	private GameColor color;
	private int freeStones;
	private int stonesOnBoard;
	private boolean isActive;
	
	public Player(GameColor color) {
		this.color = color;
		this.freeStones = 9;
		this.stonesOnBoard = 0;
		if(color == GameColor.Black){
			isActive = true;
		}else{
			isActive = false;
		}
	}
	
	public Player(int freeStones, int stonesOnBoard, boolean isActive,
			GameColor color) {
		this.color = color;
		this.freeStones = freeStones;
		this.stonesOnBoard = stonesOnBoard;
		this.isActive = isActive;
	}
	
	public GameColor getColor(){
		return this.color;
	}

	public void reset(){
		//TODO
	}

	public int getFreeStones() {
		return this.freeStones;
	}

	public boolean getIsActive() {
		return this.isActive;
	}

	public int getStonesOnBoard() {
		return this.stonesOnBoard;
	}

	public void toggleActive() {
		this.isActive = isActive?false:true;	
	}

	public void addStoneToBoard() {
		this.removeFreeStone();
		this.stonesOnBoard++;
	}

	public void removeStoneFromBoard() {
		if(this.stonesOnBoard>0){
			this.stonesOnBoard--;
		}		
	}

	public void removeFreeStone() {
		if(this.freeStones>0){
			this.freeStones--;
		}
	}
}
